#include <iostream>
#include <deque>
#include <list>
using std::cout;
using std::endl;
using namespace std;

template <class T>
void display(const T& container){
    for(const auto &elem : container){
        cout << elem << " ";
    }
    cout << endl;
}

void test(){
    list<int> list_num = {151, 135, 651, 316, 484, 113, 894, 513};
    deque<int> odd;
    deque<int> even;

    for(auto& num : list_num){
        if(num & 1){
            odd.push_back(num);
        }else{
            even.push_back(num);
        }
    }

    display(odd);
    display(even);
}

int main()
{
    test();
    return 0;
}

